package bit1;
import java.util.Arrays;
import java.util.Scanner;
public class Main11 {
    public static void ht(int n,char a,char b,char c){
        if(n==1){
            System.out.println(a+"->"+c);
        }
        else{
            ht(n-1,a,c,b);
            System.out.println(a+"->"+c);
            ht(n-1,b,a,c);
        }
    }
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int n=in.nextInt();
        ht(n,'A','B','C');
    }
    public static int ret1(int n){
        if(n==1||n==0)
            return 1;
        return n*ret1(n-1);
    }
    public static void main14(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt();
        System.out.println(ret1(n));
    }
    public static int sum(int n){
        if(n==0)
        {
            return 0;
        }
        return n+sum(n-1);
    }
    public static void main13(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        sum(n);
        System.out.println(sum(n));
    }
    public static void number(int n){
        if(n<10){
            System.out.print(n+" ");
        }
        else {
            number(n/10);
            System.out.print(n%10+" ");
        }
    }
    public static void main12(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        number(n);
    }
    public static int sum1(int n){
        if(n<10){
            return n;
        }
        return n%10+sum(n/10);
    }
    public static void main11(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        System.out.println(sum(n));
    }
    public static int fib(int n){
        if(n==1||n==2)
            return 1;
        return fib(n-2)+fib(n-1);
    }
    public static void main10(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        System.out.println(fib(n));
    }
    public static int leap(int n){
        if(n==1||n==0){
            return 1;
        }
        return leap(n-1)+leap(n-2);
    }
    public static void main9(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        System.out.println(leap(n));
    }
    public static int add(int n1,int n2){
        return n1+n2;
    }
    public static double add(double n1,double n2){
        return n1+n2;
    }
    public static void main8(String[] args) {
        Scanner in=new Scanner(System.in);
        int n1=in.nextInt();
        int n2=in.nextInt();
        int sum=add(n1,n2);
        System.out.println(sum);
        double n3=in.nextDouble();
        double n4=in.nextDouble();
        double doubleSum=add(n3,n4);
        System.out.println(doubleSum);
    }
    public static int max(int  n1,int n2){
        if(n1>n2)
            return n1;
        return n2;
    }
    public static double max(double  n1,double n2){
        if(n1>n2)
            return n1;
        return n2;
    }
    public static double max(double  n1,double n2,double n3){
        double max1=max(n1,n2);
        max1=max(max1,n3);
        return max1;
    }
    public static void main7(String[] args) {
        Scanner in=new Scanner(System.in);
        int n1=in.nextInt();
        int n2=in.nextInt();
        int intMax=max(n1,n2);
        System.out.println(intMax);
        double n3=in.nextDouble();
        double n4=in.nextDouble();
        double doubleMax=max(n3,n4);
        System.out.println(doubleMax);
        double max3=max(n4,n3,n1);
        System.out.println(max3);
    }
    public static int max2(int n1,int n2){
        if(n1>n2){
            return n1;
        }
        return n2;
    }
    public static int max3(int n1,int n2,int n3){
        int max=max2(n1,n2);
        max=max2(max,n3);
        return max;
    }
    public static void main6(String[] args) {
        Scanner in=new Scanner(System.in);
        int n1=in.nextInt();
        int n2=in.nextInt();
        int n3=in.nextInt();
        int max=max3(n1,n2,n3);
        System.out.println("max="+max);
    }
    public static void main5(String[] args) {
        int a[]=new int[]{4,5,6,8,9,12,1,1,3,5};
        int start=0;
        int end=a.length-1;
        while (start<end){
            while (start<=end&&a[start]%2!=0){
                start++;
            }
            while (start<=end&&a[end]%2==0){
                end--;
            }
            int tmp=a[start];
            a[start]=a[end];
            a[end]=tmp;
        }
        String st=Arrays.toString(a);
        System.out.println(st);
    }
    public static void main4(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int ret=1;
        for (int i = 1; i <=n ; i++) {
            ret*=i;
        }
        System.out.println(ret);
    }
    public static void main3(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int ret=1;
        int sum=0;
        for (int i = 1; i <=n ; i++) {
            ret*=i;
            sum+=ret;
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int f1=1;
        int f2=1;
        int f3=0;
        if(n<3) {
            System.out.println(f1);
        }
        else {
            for (int i = 3; i <=n; i++) {
                f3=f1+f2;
                f1=f2;
                f2=f3;
            }
            System.out.println(f3);
        }

    }
    public static void main1(String[] args) {
        int res=0;
        int []a=new int[]{1,5,6,8,8,9,9,1,5};
        for (int i = 0; i < a.length; i++) {
            res^=a[i];
        }
        System.out.println(res);
    }
}
